```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分布式缓存问题解析 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
        }
        h1, h2, h3, h4, .font-serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .problem-card {
            transition: all 0.3s ease;
        }
        .problem-card:hover {
            transform: translateY(-8px);
        }
        .solution-item {
            transition: all 0.2s ease;
        }
        .solution-item:hover {
            background-color: #f8fafc;
        }
    </style>
</head>
<body class="antialiased bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <div class="inline-block px-4 py-2 mb-6 bg-white bg-opacity-20 rounded-full backdrop-filter backdrop-blur-sm">
                <span class="text-sm font-medium">分布式系统设计</span>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">应对分布式缓存的三大挑战</h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto mb-8 font-serif">缓存雪崩、穿透与击穿：问题解析与最佳实践</p>
            <div class="flex justify-center space-x-4">
                <a href="#snowslide" class="px-6 py-3 bg-white text-indigo-700 rounded-lg font-medium hover:bg-opacity-90 transition">缓存雪崩</a>
                <a href="#penetration" class="px-6 py-3 border-2 border-white text-white rounded-lg font-medium hover:bg-white hover:bg-opacity-10 transition">缓存穿透</a>
                <a href="#breakdown" class="px-6 py-3 border-2 border-white text-white rounded-lg font-medium hover:bg-white hover:bg-opacity-10 transition">缓存击穿</a>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-8 md:mb-0 md:pr-10">
                    <div class="bg-indigo-50 p-6 rounded-xl">
                        <div class="mermaid">
                            graph TD
                                A[客户端请求] --> B{缓存命中?}
                                B -->|是| C[返回缓存数据]
                                B -->|否| D[访问数据库]
                                D --> E[数据库负载]
                                E -->|高负载| F[系统崩溃风险]
                                style A fill:#6366f1,color:#fff
                                style C fill:#10b981,color:#fff
                                style D fill:#f59e0b,color:#fff
                                style F fill:#ef4444,color:#fff
                        </div>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <h2 class="text-3xl font-bold mb-6 font-serif">缓存问题的核心影响</h2>
                    <p class="text-gray-700 mb-6">在现代分布式系统中，缓存是提升性能的关键组件。然而，错误的缓存策略可能导致严重的系统问题，甚至引发级联故障。</p>
                    <div class="flex mb-4">
                        <div class="flex-shrink-0 text-indigo-500 mr-3">
                            <i class="fas fa-exclamation-triangle text-xl"></i>
                        </div>
                        <div>
                            <p class="text-gray-700">缓存问题通常表现为数据库负载突增、响应时间延长，最终可能引发服务不可用。</p>
                        </div>
                    </div>
                    <div class="flex mb-4">
                        <div class="flex-shrink-0 text-indigo-500 mr-3">
                            <i class="fas fa-shield-alt text-xl"></i>
                        </div>
                        <div>
                            <p class="text-gray-700">理解这些问题并实施适当的防护措施，是构建健壮分布式系统的必要条件。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Problems Overview -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <h2 class="text-3xl font-bold mb-12 text-center font-serif">三大缓存问题概览</h2>
            <div class="grid md:grid-cols-3 gap-8">
                <!-- 缓存雪崩 -->
                <div id="snowslide" class="problem-card bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300">
                    <div class="bg-gradient-to-r from-blue-500 to-blue-600 p-6">
                        <div class="flex items-center">
                            <div class="bg-white bg-opacity-20 p-3 rounded-lg mr-4">
                                <i class="fas fa-mountain text-white text-2xl"></i>
                            </div>
                            <h3 class="text-xl font-bold text-white">缓存雪崩</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">大量缓存同时失效，导致数据库瞬时压力剧增</p>
                        <div class="flex items-center text-sm text-blue-600 font-medium">
                            <span>了解更多</span>
                            <i class="fas fa-arrow-right ml-2"></i>
                        </div>
                    </div>
                </div>

                <!-- 缓存穿透 -->
                <div id="penetration" class="problem-card bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300">
                    <div class="bg-gradient-to-r from-purple-500 to-purple-600 p-6">
                        <div class="flex items-center">
                            <div class="bg-white bg-opacity-20 p-3 rounded-lg mr-4">
                                <i class="fas fa-search-minus text-white text-2xl"></i>
                            </div>
                            <h3 class="text-xl font-bold text-white">缓存穿透</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">查询不存在的数据，绕过缓存直达数据库</p>
                        <div class="flex items-center text-sm text-purple-600 font-medium">
                            <span>了解更多</span>
                            <i class="fas fa-arrow-right ml-2"></i>
                        </div>
                    </div>
                </div>

                <!-- 缓存击穿 -->
                <div id="breakdown" class="problem-card bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300">
                    <div class="bg-gradient-to-r from-red-500 to-red-600 p-6">
                        <div class="flex items-center">
                            <div class="bg-white bg-opacity-20 p-3 rounded-lg mr-4">
                                <i class="fas fa-bolt text-white text-2xl"></i>
                            </div>
                            <h3 class="text-xl font-bold text-white">缓存击穿</h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-700 mb-4">热点数据失效，导致大量请求直接访问数据库</p>
                        <div class="flex items-center text-sm text-red-600 font-medium">
                            <span>了解更多</span>
                            <i class="fas fa-arrow-right ml-2"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 缓存雪崩详情 -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-8">
                <div class="bg-blue-100 p-3 rounded-lg mr-4">
                    <i class="fas fa-mountain text-blue-600 text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold font-serif">缓存雪崩</h2>
            </div>
            
            <div class="bg-gray-50 rounded-xl p-6 mb-10">
                <p class="text-gray-700 mb-0">当缓存系统中大量缓存数据在同一时间失效，导致大量请求直接访问数据库，从而使数据库负载剧增，可能导致数据库崩溃。</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">原因</span>
                    </h3>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-blue-500">
                                <i class="fas fa-clock"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">缓存失效时间集中</h4>
                                <p class="text-gray-700">大量缓存数据在相同时间点失效，导致请求短时间内集中到数据库。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-blue-500">
                                <i class="fas fa-database"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">缓存重建压力</h4>
                                <p class="text-gray-700">缓存失效后，系统中的所有请求都需要重新从数据库加载数据，可能导致数据库瞬间承受过大压力。</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-green-100 text-green-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">解决方案</span>
                    </h3>
                    <div class="space-y-4">
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">缓存失效时间随机化</h4>
                            <p class="text-gray-700">通过将缓存的过期时间设置为随机值，避免所有缓存数据在同一时间失效。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">缓存预热</h4>
                            <p class="text-gray-700">在系统启动或部署新版本时，预先加载常用的数据到缓存中。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">数据过期策略</h4>
                            <p class="text-gray-700">使用滑动窗口或延迟过期策略，逐步使缓存数据失效。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">限流和降级</h4>
                            <p class="text-gray-700">实现请求限流和服务降级策略，防止系统在缓存雪崩期间过载。</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="bg-blue-50 rounded-xl p-6">
                <h3 class="text-xl font-bold mb-4 text-blue-800">技术实现示例</h3>
                <div class="mermaid">
                    sequenceDiagram
                        participant C as Client
                        participant S as Server
                        participant DB as Database
                        C->>S: 请求数据
                        alt 缓存命中
                            S->>C: 返回缓存数据
                        else 缓存雪崩场景
                            S->>DB: 大量并发查询
                            DB-->>S: 数据结果
                            S->>S: 使用互斥锁重建缓存
                            S->>C: 返回数据
                        end
                </div>
            </div>
        </div>
    </section>

    <!-- 缓存穿透详情 -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 p-3 rounded-lg mr-4">
                    <i class="fas fa-search-minus text-purple-600 text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold font-serif">缓存穿透</h2>
            </div>
            
            <div class="bg-gray-50 rounded-xl p-6 mb-10">
                <p class="text-gray-700 mb-0">请求的数据在缓存中不存在，同时也不在数据库中。这导致每次请求都直接访问数据库，从而绕过了缓存机制。</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-purple-100 text-purple-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">原因</span>
                    </h3>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-purple-500">
                                <i class="fas fa-user-secret"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">恶意请求</h4>
                                <p class="text-gray-700">攻击者发送大量不存在的数据请求，导致缓存和数据库都被频繁访问。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-purple-500">
                                <i class="fas fa-filter"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">查询条件不正确</h4>
                                <p class="text-gray-700">请求的查询条件不匹配缓存中存储的数据，导致缓存未命中。</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-green-100 text-green-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">解决方案</span>
                    </h3>
                    <div class="space-y-4">
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">缓存空数据</h4>
                            <p class="text-gray-700">对于缓存未命中的请求，可以在缓存中存储一个空对象或标记，并设置合适的过期时间。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">布隆过滤器</h4>
                            <p class="text-gray-700">使用布隆过滤器来检测请求的数据是否可能存在，避免不必要的数据库查询。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">参数校验</h4>
                            <p class="text-gray-700">对请求参数进行有效性校验，过滤掉无效或非法请求。</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="bg-purple-50 rounded-xl p-6">
                <h3 class="text-xl font-bold mb-4 text-purple-800">布隆过滤器原理</h3>
                <div class="mermaid">
                    graph LR
                        A[请求数据] --> B{布隆过滤器检查}
                        B -->|可能存在| C[查询缓存]
                        B -->|肯定不存在| D[直接返回空]
                        C -->|存在| E[返回缓存数据]
                        C -->|不存在| F[查询数据库]
                        F -->|存在| G[更新缓存并返回]
                        F -->|不存在| H[缓存空结果]
                        style D fill:#10b981,color:#fff
                </div>
            </div>
        </div>
    </section>

    <!-- 缓存击穿详情 -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-8">
                <div class="bg-red-100 p-3 rounded-lg mr-4">
                    <i class="fas fa-bolt text-red-600 text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold font-serif">缓存击穿</h2>
            </div>
            
            <div class="bg-gray-50 rounded-xl p-6 mb-10">
                <p class="text-gray-700 mb-0">当缓存中的某个热点数据失效时，大量请求同时访问该数据，导致缓存失效的同时直接访问数据库，造成数据库压力过大。</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-red-100 text-red-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">原因</span>
                    </h3>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-red-500">
                                <i class="fas fa-fire"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">热点数据</h4>
                                <p class="text-gray-700">某些数据被频繁访问且缓存失效，导致大量请求同时涌入数据库。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 mt-1 mr-3 text-red-500">
                                <i class="fas fa-clock"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-gray-900">缓存失效</h4>
                                <p class="text-gray-700">缓存失效后，所有请求都需要重新从数据库加载数据。</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <span class="bg-green-100 text-green-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">解决方案</span>
                    </h3>
                    <div class="space-y-4">
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">互斥锁</h4>
                            <p class="text-gray-700">使用分布式锁确保在缓存失效时，只有一个请求可以从数据库加载数据并更新缓存。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">缓存预加载</h4>
                            <p class="text-gray-700">对于热点数据，在缓存失效之前进行预加载，确保数据在缓存中始终可用。</p>
                        </div>
                        <div class="solution-item p-4 rounded-lg border border-gray-200">
                            <h4 class="font-medium text-gray-900 mb-2">热点数据保护</h4>
                            <p class="text-gray-700">采用更长的缓存过期时间或使用本地缓存加分布式缓存的组合。</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="bg-red-50 rounded-xl p-6">
                <h3 class="text-xl font-bold mb-4 text-red-800">互斥锁实现流程</h3>
                <div class="mermaid">
                    sequenceDiagram
                        participant C1 as Client 1
                        participant C2 as Client 2
                        participant S as Server
                        participant DB as Database
                        C1->>S: 请求热点数据
                        S->>S: 缓存失效
                        S->>S: 获取分布式锁
                        S->>DB: 查询数据库
                        DB-->>S: 返回数据
                        S->>S: 更新缓存
                        S->>S: 释放锁
                        S->>C1: 返回数据
                        C2->>S: 请求热点数据
                        S->>S: 等待锁释放
                        S->>C2: 从缓存返回数据
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Table -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <h2 class="text-3xl font-bold mb-12 text-center font-serif">三大缓存问题对比</h2>
            <div class="overflow-x-auto">
                <table class="min-w-full bg-white rounded-lg overflow-hidden">
                    <thead class="bg-gray-100">
                        <tr>
                            <th class="py-3 px-4 text-left font-medium text-gray-700">问题类型</th>
                            <th class="py-3 px-4 text-left font-medium text-gray-700">触发条件</th>
                            <th class="py-3 px-4 text-left font-medium text-gray-700">影响范围</th>
                            <th class="py-3 px-4 text-left font-medium text-gray-700">解决方案要点</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200">
                        <tr class="hover:bg-gray-50">
                            <td class="py-4 px-4 font-medium text-blue-600">缓存雪崩</td>
                            <td class="py-4 px-4">大量缓存同时失效</td>
                            <td class="py-4 px-4">系统级，影响所有相关数据</td>
                            <td class="py-4 px-4">随机失效时间、缓存预热、限流</td>
                        </tr>
                        <tr class="hover:bg-gray-50">
                            <td class="py-4 px-4 font-medium text-purple-600">缓存穿透</td>
                            <td class="py-4 px-4">查询不存在的数据</td>
                            <td class="py-4 px-4">特定查询，可能被恶意利用</td>
                            <td class="py-4 px-4">布隆过滤器、空值缓存、参数校验</td>
                        </tr>
                        <tr class="hover:bg-gray-50">
                            <td class="py-4 px-4 font-medium text-red-600">缓存击穿</td>
                            <td class="py-4 px-4">热点数据失效</td>
                            <td class="py-4 px-4">特定热点数据，瞬时高压</td>
                            <td class="py-4 px-4">互斥锁、热点保护、预加载</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </section>

    <!-- Summary -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-3xl text-center">
            <div class="bg-indigo-50 inline-block p-3 rounded-full mb-6">
                <i class="fas fa-lightbulb text-indigo-600 text-2xl"></i>
            </div>
            <h2 class="text-3xl font-bold mb-6 font-serif">最佳实践总结</h2>
            <p class="text-gray-700 mb-8">构建健壮的缓存系统需要综合考虑各种异常情况。通过合理的缓存策略、失效机制和防护措施，可以显著提升系统的可用性和性能。</p>
            
            <div class="grid md:grid-cols-3 gap-6 mb-12">
                <div class="bg-gray-50 p-6 rounded-lg">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-random"></i>
                    </div>
                    <h3 class="font-bold mb-2">多样化失效时间</h3>
                    <p class="text-gray-700 text-sm">避免同时失效导致雪崩</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-lg">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-shield-alt"></i>
                    </div>
                    <h3 class="font-bold mb-2">防御性设计</h3>
                    <p class="text-gray-700 text-sm">预防穿透和击穿问题</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-lg">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-chart-line"></i>
                    </div>
                    <h3 class="font-bold mb-2">监控与调优</h3>
                    <p class="text-gray-700 text-sm">持续优化缓存策略</p>
                </div>
            </div>
            
            <div class="bg-indigo-50 rounded-xl p-6 text-left">
                <h3 class="text-xl font-bold mb-4 text-indigo-800">完整解决方案示例</h3>
                <div class="mermaid">
                    graph TD
                        A[客户端请求] --> B{布隆过滤器}
                        B -->|不存在| C[返回空]
                        B -->|可能存在| D{缓存查询}
                        D -->|命中| E[返回缓存]
                        D -->|未命中| F[获取分布式锁]
                        F --> G[查询数据库]
                        G --> H[更新缓存]
                        H --> I[释放锁]
                        I --> J[返回数据]
                        style C fill:#10b981,color:#fff
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-12 px-4">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-xl font-bold mb-2">技术小馆</h3>
                    <p class="text-gray-400">探索技术之美，分享架构之道</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300 flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        <span>访问语雀主页</span>
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            fontFamily: "'Noto Sans SC', sans-serif",
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            sequenceDiagram: {
                useMaxWidth: true,
                height: 300
            }
        });
    </script>
</body>
</html>
```